import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.Locale;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        StringBuilder stringBuilder=new StringBuilder("abcdef");
        stringBuilder.insert(2,"hhhh");
        //stringBuilder.reverse();
        Scanner in = new Scanner(System.in);
        String string=in.nextLine();
        System.out.println(stringBuilder);

    }
    public static void main14(String[] args) {
        StringBuilder stringBuilder=new StringBuilder();
        stringBuilder.append("hello");
        stringBuilder.append(" world");
        String s=stringBuilder.toString();
        System.out.println(s);
    }
    public static void main13(String[] args) {
        String s1="hello";
        s1+="  world";
        System.out.println(s1);
    }
    public static void main12(String[] args) {
        String s="     a   b    cde    f      ";
        String ss=s.trim();
        System.out.println(ss);
    }
    public static void main11(String[] args) {
        String s="abcdefg";
        String sub=s.substring(2,5);
        System.out.println(sub);
    }
    public static void main10(String[] args) {
        String s1="name=sherry&age=20";
        String s2="192.168.0";
        String s3="192\\168\\0";
        String[] strings=s1.split("&|=");
        String[] strings1=s2.split("\\.");
        String[] strings2=s3.split("\\\\");
        for (String S:strings) {
            System.out.println(S);
        }
    /*    for (int i = 0; i < strings.length; i++) {
            String[] strings2=strings[i].split("=");
            for (String S:strings2) {
                System.out.println(S);
            }
        }*/
    }
    public static void main9(String[] args) {
        String s1="name=sherry&age=20";
        String s2="hello world I love you";
        String[] strings=s1.split("&");
        String[] strings2=s2.split(" ",2);
        for (String s:strings2) {
            System.out.println(s);
        }
    }
    public static void main8(String[] args) {
        String s="aaaaaaaaaabbbbbbbbbbbb";
        String S1=s.replace('a','k');
        String S2=s.replaceFirst("a","k");
        System.out.println(S1);
        System.out.println(S2);
    }
    public static void main7(String[] args) {
        String S=String.format("%d-%d-%d",2024,9,27);
        System.out.println(S);
    }
    public static void main6(String[] args) {
        String s1="hello";
        char[] ch=s1.toCharArray();
        System.out.println(ch[0]);
    }
    public static void main5(String[] args) {
        String s1="hello";
        String s2=s1.toUpperCase();
        String s3=s2.toLowerCase();
        System.out.println(s3);
    }
    public static void main4(String[] args) {
        String s1=String.valueOf(1234);
        String s2=String.valueOf(12.34);
        int i=Integer.parseInt(s1);
        double d=Double.parseDouble(s2);
        System.out.println(s1);
    }
    public static void main3(String[] args) {
        String s1="hello";
        char c=s1.charAt(0);
         //System.out.println(c);

        int index=s1.indexOf('l');
        int index2=s1.indexOf('l',3);
        int index3=s1.indexOf("ll",3);
        int index4=s1.lastIndexOf('l') ;
        //System.out.println(index);
        System.out.println(index4);
    }
    public static void main2(String[] args) {
        String string1=new String("Abcdef");
        String string2=new String("abcdef");
        String string3=new String("abcdef");
        String string4=new String("abcdefg");
       /* System.out.println(string2.compareTo(string1));
        System.out.println(string2.compareTo(string4));*/
        System.out.println(string1.compareTo(string3));
        System.out.println(string1.compareToIgnoreCase(string3));
    }
    public static void main1(String[] args) {
        String string1="hello";
        String string2=new String("world");
        char[] value={'a','b','c'};
        String string3=new String(value);
        String string4=string1;
        String string5=new String("hello");
        System.out.println(string1==string5);
        System.out.println(string1==string2);
        System.out.println(string1.equals(string4));
        System.out.println(string1.equals(string2));
        /*System.out.println(string1);
        System.out.println(string2);
        System.out.println(string3);*/

    }
}
